Skip to content

Improve integration tests and fix some intemittent tests - #3033

Merged
aleDsz merged 17 commits into
mainfrom
ale-test-improvements
Jul 16, 2025
Merged

Improve integration tests and fix some intemittent tests#3033
aleDsz merged 17 commits into
mainfrom
ale-test-improvements

Conversation

@aleDsz

@aleDsz aleDsz commented Jul 15, 2025

Copy link
Copy Markdown
Member

No description provided.

@aleDsz aleDsz self-assigned this Jul 15, 2025
Comment thread lib/livebook/hubs/team_client.ex
Comment thread lib/livebook/hubs.ex Outdated
Comment thread lib/livebook/apps.ex Outdated
Comment thread lib/livebook/hubs/team_client.ex Outdated
Comment thread lib/livebook/hubs/team_client.ex Outdated
Comment thread lib/livebook/hubs/team_client.ex Outdated
Comment thread lib/livebook/apps.ex Outdated
Comment thread test/support/app_helpers.ex Outdated
@jonatanklosko

Copy link
Copy Markdown
Member

Last comment, otherwise looks good to me :)

@aleDsz

aleDsz commented Jul 16, 2025

Copy link
Copy Markdown
Member Author

There's still a test that fails everytime you run with integration tests: sends status events about running app specs (Livebook.Apps.ManagerTest) (test/livebook/apps/manager_test.exs:116).

I tried the approach to send individual messages only for test env and only to a certain topic and it still intemittent due to concurrency.

@jonatanklosko

jonatanklosko commented Jul 16, 2025

Copy link
Copy Markdown
Member

@aleDsz the issue is that in that test we expect only one permanent app:

Apps.set_startup_app_specs([app_spec])
Apps.Manager.sync_permanent_apps()
assert_receive {:apps_manager_status, [%{app_spec: ^app_spec, running?: false}]}
assert_receive {:apps_manager_status, [%{app_spec: ^app_spec, running?: true}]}

however there are leftover Team hubs from other tests and some of them have app deployments, so there are extra statuses in the list. Normally we could relax the assertions to entry in list, but here it is a bit problematic, because there may be multiple messages and we use the pattern match to wait for a specific one.

I figured the best solution is to make sure there are no leftover Team hubs in the first place, so I added on_exit to do that in fefd552 :)

@josevalim josevalim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am happy. If @jonatanklosko is happy, we can ship it!

@jonatanklosko jonatanklosko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐑

@aleDsz
aleDsz merged commit 98561f9 into main Jul 16, 2025
4 checks passed
@hugobarauna
hugobarauna deleted the ale-test-improvements branch August 18, 2025 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants